/*
 * @Description: 添加字段显隐规则-数据字典配置
 * @Autor: gufuyan
 * @Date: 2021-11-15 11:39:01
 * @lastModifiedBy: gufuyan
 * @LastEditTime: 2021-12-03 15:44:24
 * @lastModifiedContent:
 */

import type { RuleOptions } from './data';

// 匹配规则
export const validationRules: RuleOptions = {
  eq: {
    text: '等于',
    status: 'eq',
    types: ['input', 'radio', 'checkbox', 'select', 'datePicker', 'dateRange'],
  },
  ne: {
    text: '不等于',
    status: 'ne',
    types: ['input', 'radio', 'select', 'datePicker', 'dateRange'],
  },
  in: { text: '等于任意一个', status: 'in', types: ['input', 'radio', 'checkbox', 'select'] },
  nin: { text: '不等于任意一个', status: 'nin', types: ['input', 'radio', 'select'] },
  like: { text: '包含', status: 'like', types: ['input', 'radio', 'checkbox', 'select'] },
  unlike: { text: '不包含', status: 'unlike', types: ['input', 'radio', 'select'] },
  empty: {
    text: '为空',
    status: 'empty',
    types: ['input', 'radio', 'checkbox', 'select', 'datePicker', 'dateRange'],
  },
  not_empty: {
    text: '不为空',
    status: 'not_empty',
    types: ['input', 'radio', 'checkbox', 'select', 'datePicker', 'dateRange'],
  },
  gte: { text: '大于等于', status: 'gte', types: ['datePicker', 'dateRange'] },
  lte: { text: '小于等于', status: 'lte', types: ['datePicker', 'dateRange'] },
  range: { text: '选择范围', status: 'range', types: ['datePicker', 'dateRange'] },
  formula: { text: '动态筛选', status: 'formula', types: ['datePicker', 'dateRange'] },
};

// 日期-动态筛选-校验值类型
export const dateFormula: { label: string; value: string }[] = [
  { label: '自定义', value: 'custom' },
  { label: '今天', value: 'today' },
  { label: '昨天', value: 'yesterday' },
  { label: '明天', value: 'tomorrow' },
  { label: '本周', value: 'thisWeek' },
  { label: '上周', value: 'lastWeek' },
  { label: '下周', value: 'nextWeek' },
  { label: '本月', value: 'thisMonth' },
  { label: '上月', value: 'lastMonth' },
  { label: '下月', value: 'nextMonth' },
  { label: '本季度', value: 'thisQuarter' },
  { label: '上季度', value: 'lastQuarter' },
  { label: '下季度', value: 'nextQuarter' },
  { label: '今年', value: 'thisYear' },
  { label: '去年', value: 'lastYear' },
  { label: '明年', value: 'nextYear' },
];

// 日期-动态筛选-校验值为 自定义
export const dateDesc: { label: string; value: string; mark: string }[] = [
  { label: '当前', value: 'custom', mark: '' },
  { label: '过去', value: 'today', mark: '-' },
  { label: '未来', value: 'yesterday', mark: '+' },
];

// 日期-动态筛选-校验值为 自定义
export const dateType: { label: string; value: string; mark: string }[] = [
  { label: '天', value: 'day', mark: 'd' },
  { label: '周', value: 'week', mark: 'w' },
  { label: '月', value: 'month', mark: 'm' },
  { label: '季', value: 'quarterly', mark: 'q' },
  { label: '年', value: 'year', mark: 'y' },
];
